package his.controller;


import his.entity.ConstantItem;
import his.service.ConstantService;
import org.example.his.common.api.CommonResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
@RequestMapping("/admin/const/")
public class ConstantItemController {

    @Autowired
    ConstantService constantService;

    @GetMapping("const_item/all")
    @ResponseBody
    public CommonResponse<List<ConstantItem>> getall_constitems(){
        return constantService.getall_constitems();
    }

    @GetMapping("const_item/search/{keyword}")
    @ResponseBody
    public CommonResponse<List<ConstantItem>> get_constitems_byidname(@PathVariable String keyword){
        return constantService.get_constitems_byidname(keyword);

    }
}
